<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>asdasdsad</title>
    </h:head>
    <h:body>
        <h:form prependId="false" id="formulario">
            <p:dataTable value="#{alumnoDao.listAll()}" var="alumno" rowKey="#{alumno.id}" id="table">
                <p:column headerText="Nombre">
                    #{alumno.nombre}
                </p:column>
                <p:column headerText="FechaInicio">
                    #{alumno.fechaInicio}
                </p:column>
                <p:column headerText="Acción">
                    <p:commandButton value="Cambiar" action="alumno?faces-redirect=true" ajax="false">
                        <f:setPropertyActionListener target="#{flash.id}" value="#{alumno.id}" />
                    </p:commandButton>
                    <p:commandButton value="Quitar" action="#{alumnoDao.remove(alumno)}" update="@all"/>
                </p:column>
            </p:dataTable>
            <p:button value="Agregar" outcome="alumno" />
            <p:messages />
        </h:form>
    </h:body>
</html>
